<!--
 * @Author: Meow
 * @Date: 2019-10-10 19:01:17
 * @LastEditors: Meow
 * @LastEditTime: 2019-11-21 21:11:25
 * @Description: 添加流程 和 添加流程节点
 -->
<template>
  <div id="ProcessManagement" class="detail" v-loading="loading">
    <div class="detail-top">
      <el-button @click="back">返回</el-button>
    </div>

    <!-- -->
    <div class="updateBox">
      <el-tabs v-model="activeName" type="card">
        <!-- tabs1:基本信息↓ -->
        <el-tab-pane label="基本信息" name="first">
          <el-form :model="formData2.skyBusiProceNodes[0]" label-width="80px">
            <el-form-item label="节点名称">
              <el-input v-model="formData2.skyBusiProceNodes[0].nodeName"></el-input>
            </el-form-item>
            <el-form-item label="业务密级">
              <el-select v-model="formData2.skyBusiProceNodes[0].secretLevel" placeholder="请选择">
                <el-option
                  v-for="item in Options1"
                  :key="item.dictName"
                  :label="item.dictName"
                  :value="item.dictName"
                ></el-option>
              </el-select>
              <!-- <el-input v-model="formData2.skyBusiProceNodes[0].secretLevel"></el-input> -->
            </el-form-item>
            <el-form-item label="节点类型">
              <el-select v-model="formData2.skyBusiProceNodes[0].nodeType" placeholder="请选择">
                <el-option
                  v-for="item in Options2"
                  :key="item.name"
                  :label="item.name"
                  :value="item.name"
                ></el-option>
              </el-select>
              <!-- <el-input v-model="formData2.skyBusiProceNodes[0].nodeType"></el-input> -->
            </el-form-item>
            <el-form-item label="业务边界">
              <el-input v-model="formData2.skyBusiProceNodes[0].businessBoundary"></el-input>
            </el-form-item>
            <el-form-item label="标签">
              <treeselect
                :multiple="true"
                :options="queryLabelTree"
                :flat="true"
                :default-expand-level="1"
                :normalizer="_normalizer"
                placeholder="选择标签"
                noOptionsText="暂无数据"
                noResultsText="没有找到匹配结果"
                noChildrenText="没有子节点"
                v-model="formData2.skyBusiProceNodes[0].label"
              />
              <!-- <el-input v-model="formData2.skyBusiProceNodes[0].labelName"></el-input> -->
            </el-form-item>
          </el-form>
          <div class="upbtn">
            <el-button type="primary" @click="update1">保存</el-button>
          </div>
        </el-tab-pane>
        <!-- tabs1:基本信息↑ -->
        <!-- tabs2:执行单位 ↓-->
        <el-tab-pane label="执行单位" name="second">
          <el-button type="primary" @click="add1">添加</el-button>
          <el-table
            :data="formData2.skyBusiExecDepartments"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            border
            style="width: 100%"
          >
            <el-table-column prop="unitName" label="单位名称" align="center"></el-table-column>
            <el-table-column prop="execOffice" label="执行处室" align="center"></el-table-column>
            <el-table-column label="操作" align="center" min-width="150">
              <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="up1(scope.$index,scope.row)">修改</el-button>
                <el-button size="mini" @click="del1(scope.$index,scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- tabs2:执行单位 ↑-->
        <!-- tabs3:信息化系统 ↓-->
        <el-tab-pane label="信息化系统" name="third">
          <el-button type="primary" @click="add2">添加</el-button>
          <el-table
            :data="formData2.skyBusiInforSystems"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            border
            style="width: 100%"
          >
            <el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
            <el-table-column prop="execRole" label="执行角色" align="center"></el-table-column>
            <el-table-column label="操作" align="center" min-width="150">
              <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="up2(scope.$index,scope.row)">修改</el-button>
                <el-button size="mini" @click="del2(scope.$index, scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- tabs3:信息化系统 ↑-->
        <!-- tabs4:上游节点 ↓-->
        <el-tab-pane label="上游节点" name="fourth">
          <el-button type="primary" @click="add3">添加</el-button>
          <el-table
            :data="formData2.skyBusiUpstreamNodes"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            border
            style="width: 100%"
          >
            <el-table-column prop="busiProceName" label="上游节点所属流程" align="center"></el-table-column>
            <el-table-column prop="parentNodeName" label="上游节点" align="center"></el-table-column>
            <el-table-column prop="accessParam" label="接入参数" align="center"></el-table-column>
            <el-table-column label="操作" align="center" min-width="150">
              <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="up3(scope.$index,scope.row)">修改</el-button>
                <el-button size="mini" @click="del3(scope.$index, scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- tabs4:上游节点 ↑-->
        <!-- tabs5:输出参数 ↓-->
        <el-tab-pane label="输出参数" name="fifth">
          <el-button type="primary" @click="add4">添加</el-button>
          <el-table
            :data="formData2.skyBusiOutputParams"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            border
            style="width: 100%"
          >
            <el-table-column prop="paramType" label="输出结果类型" align="center"></el-table-column>
            <el-table-column prop="systemName" label="所属系统" align="center"></el-table-column>
            <el-table-column prop="paramName" label="参数名称" align="center"></el-table-column>
            <el-table-column label="操作" align="center" min-width="150">
              <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="up4(scope.$index,scope.row)">修改</el-button>
                <el-button size="mini" @click="del4(scope.$index, scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- tabs5:输出参数 ↑-->
        <!-- tabs6:业务规则 ↓-->
        <el-tab-pane label="业务规则" name="sixth">
          <el-button type="primary" @click="add5">添加</el-button>
          <el-table
            :data="formData2.skyBusiRules"
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            border
            style="width: 100%"
          >
            <el-table-column prop="ruleType" label="规则类型" align="center"></el-table-column>
            <el-table-column prop="ruleSummary" label="规则概述" align="center"></el-table-column>
            <el-table-column prop="manageRule" label="治理规则" align="center"></el-table-column>
            <el-table-column label="操作" align="center" min-width="150">
              <template slot-scope="scope">
                <el-button size="mini" type="primary" @click="up5(scope.$index,scope.row)">修改</el-button>
                <el-button size="mini" @click="del5(scope.$index, scope.row)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <!-- tabs6:业务规则 ↑-->
      </el-tabs>
    </div>
    <!-- -->

    <!-- 弹出层 [执行单位的添加]↓-->
    <el-dialog title="添加执行单位" :visible.sync="showDialog1" width="30%">
      <el-form label-width="80px">
        <el-form-item label="执行单位:">
          <el-select v-model="templateJson1.unitName" placeholder="请选择">
            <!-- 执行单位下拉框 -->
            <el-option
              v-for="item in Aoptions1"
              :key="item.name"
              :label="item.name"
              :value="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- 执行处室下拉框 ※暂用input -->
        <el-form-item label="执行处室:">
          <el-input v-model="templateJson1.execOffice"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog1 = false">取 消</el-button>
        <el-button type="primary" @click="sure1">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [执行单位的添加]↑ -->
    <!-- 弹出层 [执行单位的修改]↓-->
    <el-dialog title="修改执行单位" :visible.sync="showDialog11" width="30%">
      <el-form label-width="80px">
        <el-form-item label="执行单位:">
          <el-select v-model="templateJson1.unitName" placeholder="请选择">
            <!-- 执行单位下拉框 -->
            <el-option
              v-for="item in Aoptions1"
              :key="item.name"
              :label="item.name"
              :value="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- 执行处室下拉框 ※暂用input -->
        <el-form-item label="执行处室:">
          <el-input v-model="templateJson1.execOffice"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog11 = false">取 消</el-button>
        <el-button type="primary" @click="update2">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [执行单位的添加]↑ -->

    <!-- 弹出层 [信息化系统的添加]↓-->
    <el-dialog title="添加信息化系统" :visible.sync="showDialog2" width="30%">
      <el-form label-width="80px">
        <el-form-item label="系统名称:">
          <el-select v-model="templateJson2.systemName" placeholder="请选择">
            <!-- 执行单位下拉框 -->
            <el-option
              v-for="item in Boptions1"
              :key="item.system_name"
              :label="item.system_name"
              :value="item.system_name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="执行角色:">
          <el-input v-model="templateJson2.execRole"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog2 = false">取 消</el-button>
        <el-button type="primary" @click="sure2">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [信息化系统的添加]↑ -->
    <!-- 弹出层 [信息化系统的修改]↓-->
    <el-dialog title="修改信息化系统" :visible.sync="showDialog22" width="30%">
      <el-form label-width="80px">
        <el-form-item label="系统名称:">
          <el-select v-model="templateJson2.systemName" placeholder="请选择">
            <!-- 执行单位下拉框 -->
            <el-option
              v-for="item in Boptions1"
              :key="item.system_name"
              :label="item.system_name"
              :value="item.system_name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="执行角色:">
          <el-input v-model="templateJson2.execRole"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog22 = false">取 消</el-button>
        <el-button type="primary" @click="update3">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [信息化系统的修改]↑ -->

    <!-- 弹出层 [上游节点的添加]↓-->
    <el-dialog title="添加上游节点" :visible.sync="showDialog3" width="30%">
      <el-form ref="form" :model="templateJson3" label-width="80px">
        <el-form-item label="所属流程:">
          <!-- <el-select
              v-model="templateJson3.parentNode"
              @change="ChangeGetCoptions"
              placeholder="请选择"
            >
              <el-option
                v-for="item in Coptions1"
                :key="item.busiProceName"
                :label="item.busiProceName"
                :value="item.busiProceId"
              ></el-option>
          </el-select>-->
          <!-- <el-input v-model="templateJson3.busiProceName" :disabled="true"></el-input> -->
          <el-input v-model="baseInfoData.busiProceName" :disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="上游节点:">
          <!-- <el-select v-model="templateJson3.parentNode" placeholder="请选择" @change="ChangeNodeName"> -->
          <el-select v-model="templateJson3.parentNode" placeholder="请选择" @change="ChangeNodeId">
            <el-option
              v-for="item in Coptions2"
              :key="item.nodeId"
              :label="item.nodeName"
              :value="item.nodeId"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="接入参数:">
          <el-input :disabled="true" v-model="templateJson3.accessParam"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog3 = false">取 消</el-button>
        <el-button type="primary" @click="sure3">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [上游节点的添加]↑ -->
    <!-- 弹出层 [上游节点的修改]↓-->
    <el-dialog title="修改上游节点" :visible.sync="showDialog33" width="30%">
      <el-form ref="form" :model="templateJson3" label-width="80px">
        <el-form-item label="所属流程:">
          <el-input v-model="baseInfoData.busiProceName" :disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="上游节点:">
          <!-- <el-select v-model="templateJson3.parentNode" placeholder="请选择" @change="ChangeNodeName"> -->
          <el-select v-model="templateJson3.parentNode" placeholder="请选择" @change="ChangeNodeId">
            <el-option
              v-for="item in Coptions2"
              :key="item.nodeId"
              :label="item.nodeName"
              :value="item.nodeId"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="接入参数:">
          <el-input :disabled="true" v-model="templateJson3.accessParam"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog33 = false">取 消</el-button>
        <el-button type="primary" @click="update4">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [上游节点]的修改]↑ -->

    <!-- 弹出层 [输出参数的添加]↓-->
    <el-dialog title="添加输出结果" :visible.sync="showDialog4" width="30%">
      <el-form ref="form" :model="templateJson4" label-width="80px">
        <el-form-item label="输出结果类型:">
          <el-select v-model="templateJson4.paramType" placeholder="请选择" @change="ChangeParamsType">
            <el-option v-for="item in Doptions1" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属系统:" v-if="templateJson4.paramType!=2">
          <el-select v-model="templateJson4.systemId" placeholder="请选择" @change="ChangeSysId">
            <el-option
              v-for="item in Doptions2"
              :key="item.system_id"
              :label="item.system_name"
              :value="item.system_id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="参数名称:">
          <template v-if="templateJson4.paramType == 2">
            <el-input v-model="templateJson4.paramName"></el-input>
          </template>
          <template v-else>
            <el-select v-model="templateJson4.paramName" placeholder="请选择">
              <el-option
                v-for="item in Doptions3"
                :key="templateJson4.paramType==0?item.interface_id:item.file_id"
                :label="templateJson4.paramType==0?item.interface_name:item.file_name"
                :value="templateJson4.paramType==0?item.interface_name:item.file_name"
              ></el-option>
            </el-select>
          </template>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog4 = false">取 消</el-button>
        <el-button type="primary" @click="sure4">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [输出参数的添加]↑ -->
    <!-- 弹出层 [输出参数的修改]↓-->
    <el-dialog title="修改输出结果" :visible.sync="showDialog44" width="30%">
      <el-form ref="form" :model="templateJson4" label-width="80px">
        <el-form-item label="参数类型:">
          <el-select v-model="templateJson4.paramType" placeholder="请选择" @change="ChangeParamsType">
            <el-option v-for="item in Doptions1" :key="item.id" :label="item.name" :value="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属系统:" v-if="templateJson4.paramType!=2">
          <el-select v-model="templateJson4.systemId" placeholder="请选择" @change="ChangeSysId">
            <el-option
              v-for="item in Doptions2"
              :key="item.system_id"
              :label="item.system_name"
              :value="item.system_id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="参数名称:">
          <template v-if="templateJson4.paramType == 2">
            <el-input v-model="templateJson4.paramName"></el-input>
          </template>
          <template v-else>
            <el-select v-model="templateJson4.paramName" placeholder="请选择">
              <el-option
                v-for="item in Doptions3"
                :key="templateJson4.paramType==0?item.interface_id:item.file_id"
                :label="templateJson4.paramType==0?item.interface_name:item.file_name"
                :value="templateJson4.paramType==0?item.interface_name:item.file_name"
              ></el-option>
            </el-select>
          </template>
          <!-- <el-input v-model="templateJson4.paramName"></el-input> -->
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog44 = false">取 消</el-button>
        <el-button type="primary" @click="update5">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [输出参数的修改]↑ -->
    <!-- 弹出层 [业务规则的添加]↓-->
    <el-dialog title="添加业务规则" :visible.sync="showDialog5" width="30%">
      <el-form ref="form" :model="templateJson5" label-width="80px">
        <el-form-item label="规则类型:">
          <el-select v-model="templateJson5.ruleType" placeholder="请选择">
            <el-option
              v-for="item in Eoptions1"
              :key="item.name"
              :label="item.name"
              :value="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="规则概述:">
          <el-input v-model="templateJson5.ruleSummary"></el-input>
        </el-form-item>
        <el-form-item label="治理规则:">
          <el-input v-model="templateJson5.manageRule"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog5 = false">取 消</el-button>
        <el-button type="primary" @click="sure5">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [业务规则的添加]↑ -->
    <!-- 弹出层 [业务规则的修改]↓-->
    <el-dialog title="修改业务规则" :visible.sync="showDialog55" width="30%">
      <el-form ref="form" :model="templateJson5" label-width="80px">
        <el-form-item label="规则类型:">
          <el-select v-model="templateJson5.ruleType" placeholder="请选择">
            <el-option
              v-for="item in Eoptions1"
              :key="item.name"
              :label="item.name"
              :value="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="规则概述:">
          <el-input v-model="templateJson5.ruleSummary"></el-input>
        </el-form-item>
        <el-form-item label="治理规则:">
          <el-input v-model="templateJson5.manageRule"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="showDialog55 = false">取 消</el-button>
        <el-button type="primary" @click="update6">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 弹出层 [业务规则的添加]↑ -->
  </div>
</template>
<script>
// 引入树选择器组件
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

import processManagementApi from "@/httpUtils/ExternalManagement/processManagement";
import metadataRegistrationApi from "@/httpUtils/ExternalManagement/metadataRegistration";
export default {
  name: "ProcessManagementView",
  components: {
    Treeselect
  },
  data() {
    return {
      loading: false, // 加载中
      // 分页配置
      tableConfig: {
        pageNum: 1, // 页码
        pageSize: 5, // 条数
        busiProceName: "", // 流程名
        total: 0 // 总数
      },
      loading: false, // 加载中
      // 标签列表相关
      treeProp3: {
        children: "child",
        label: "name",
        value: "id",
        multiple: true
      },
      versionId: "", // 该流程版本ID
      baseInfoDisable: false,
      busiProceId: "", //流程ID
      isStep1: true, // 是否是步骤1 ※步骤1:添加业务流程 步骤2:对该流程添加流程节点
      // 步骤1: 添加业务流程时所需的基本信息数据参数
      baseInfoData: {
        busiProceName: "", // 业务流程Name
        busiProceId: "", // 业务流程Id
        parentId: "", // 父流程id 下拉列表的ID
        parentName: "", // 父流程名称 下拉列表的label
        summary: "", // 概述
        label: null, // 标签
        parentNode: "", // 父节点ID 下拉列表的ID
        parentNodeName: "" // 父节点名称 下拉列表的label
      },
      // 对刚添加业务流程添加流程节点时所需的参数表单
      formData2: {
        // 基本信息
        skyBusiProceNodes: [
          {
            nodeName: "", // 节点名称
            nodeType: "", //  节点类型
            businessBoundary: "", // 业务边界
            label: null, // 标签
            secretLevel: "", // 业务密级
            busiProceId: "", // 流程ID
            versionId: "" // 版本ID
          }
        ],
        // 执行单位
        skyBusiExecDepartments: [
          // {
          //   unitName: "自然资源局12",
          //   execOffice: "办公室12"
          // },
          // {
          //   unitName: "自然资源局22",
          //   execOffice: "办公室22"
          // }
        ],
        // 信息化系统
        skyBusiInforSystems: [
          // {
          //   systemName: "系统A12",
          //   execRole: "超级管理12员"
          // },
          // {
          //   systemName: "系统A22",
          //   execRole: "超级管理员22"
          // }
        ],
        // 上游节点
        skyBusiUpstreamNodes: [
          // {
          //   parentNode: "设计初设12",
          //   accessParam: "初设专题图层21",
          //   busiProceName: "当前业务流程名"
          // },
          // {
          //   parentNode: "设计初设22",
          //   accessParam: "初设专题图层22",
          //   busiProceName: "当前业务流程22"
          // }
        ],
        // 输出参数
        skyBusiOutputParams: [
          // {
          //   paramType: "接口21", // 参数类型
          //   systemName: "系统A21", // 所属系统
          //   paramName: "地名21" // 参数名称
          // },
          // {
          //   paramType: "接口22",
          //   systemName: "系统A22",
          //   paramName: "地名22"
          // }
        ],
        // 业务规则
        skyBusiRules: [
          // {
          //   ruleType: "参数接入规则21", // 规则类型
          //   ruleSummary: "测试21", // 规则概述
          //   manageRule: "测试21" // 治理规则
          // },
          // {
          //   ruleType: "参数接入规则22",
          //   ruleSummary: "测试22",
          //   manageRule: "测试22"
          // }
        ]
      },
      // 执行单位模版
      templateJson1: {
        unitName: "", // 单位名称
        execOffice: "" // 执行处室
      },
      // 信息化系统模版
      templateJson2: {
        systemName: "", // 系统名称
        execRole: "" // 执行角色
      },
      // 上游节点模版
      templateJson3: {
        parentNode: "", // 上游节点id
        accessParam: "", // 接入参数
        busiProceName: "" // 上游节点所属流程名
        // busiProceId: "" // 上游节点所属流程ID
      },
      // 输出参数模版
      templateJson4: {
        paramType: "0", // 参数类型
        systemName: "", // 所属系统
        paramName: "" // 参数名称
      },
      // 业务规则模版
      templateJson5: {
        ruleType: "", // 规则类型
        ruleSummary: "", // 规则概述
        manageRule: "" // 治理规则
      },
      CurrentSelectSysId: "", // 当前选中系统ID
      CurrentSelectParamsType: "0", // 当前选中参数类型
      // 业务密级下拉列表
      Options1: [
        { name: "机密" },
        { name: "绝密" },
        { name: "秘密" },
        { name: "敏感" }
      ],
      // 节点类型
      Options2: [
        { name: "实体节点" },
        { name: "判断节点" },
        { name: "线下节点" }
      ],
      // 弹出层下拉列表数据------------
      Aoptions1: [], // 单位名称下拉列表
      Aoptions2: [], // 执行处室下拉列表
      Boptions1: [], // 系统名称下拉列表
      Coptions1: [], // 上游节点所属流程下拉列表
      Coptions2: [], // 上游节点下拉列表
      Coptions3: [], // 上游节点下拉列表
      Doptions1: [
        { name: "文件", id: "1" },
        { name: "接口", id: "0" },
        { name: "其他", id: "2" }
      ], // 输出参数-参数类型下拉列表
      Doptions2: [], // 输出参数(所属系统下拉列表)
      Doptions3: [], // 参数名称
      Eoptions1: [{ name: "参数接入规则" }, { name: "异常处理规则" }], // 输出参数-所属系统下拉列表

      fatherFlowOptions: [], // 父流程下拉列表数据
      fatherNodeOptions: [], // 父节点下拉列表数据

      activeName: "first", // 当前弹出层
      showDialog: false, // 是否显示总弹出层
      showDialog1: false, // [执行单位]添加弹出层
      showDialog2: false, // [信息化系统]添加是否显示总弹出层
      showDialog3: false, // [上游节点]添加是否显示总弹出层
      showDialog4: false, // [输出参数]添加是否显示总弹出层
      showDialog5: false, // [业务规则]添加是否显示总弹出层
      showDialog11: false, // [执行单位]修改弹出层
      showDialog22: false, // [信息化系统]修改是否显示总弹出层
      showDialog33: false, // [上游节点]修改是否显示总弹出层
      showDialog44: false, // [输出参数]修改是否显示总弹出层
      showDialog55: false, // [业务规则]修改是否显示总弹出层
      NodeForm: [],
      queryLabelTree: []
    };
  },
  created() {
    let nodeId = this.$route.query.nodeId;
    let busiProceId = this.$route.query.busiProceId;
    let versionId = this.$route.query.versionId;
    console.log("nodeId", nodeId);
    console.log("busiProceId", busiProceId);
    console.log("versionId", versionId);
    // return
    // nodeId = "1000000256754497";
    // busiProceId = "1000001507053665";
    this.nodeId = nodeId; // 节点ID
    this.busiProceId = busiProceId; // 节点所属流程id
    console.log(nodeId);
    this.GetLabelTree();
    this.GetBaseInfo(versionId); // 获取流程基本信息
    this.GetInfoData(nodeId); // 获取节点基本信息
    this.GetskyBusiExecDepartments(nodeId); // 获取执行单位数据
    this.GetBusinessInfoSystem(nodeId); // 获取信息化系统
    this.BusinessUpstreamNode(nodeId); // 获取上游节点
    this.BusinessOutputParam(nodeId); // 获取输出参数
    this.BusinessRule(nodeId); // 获取业务规则
    this.GetOptions1();
  },
  methods: {
    // 获取业务密级下拉列表
    GetOptions1() {
      processManagementApi
        .queryDictInfoByType({
          typeCode: "1000001020219608"
        })
        .then(res => {
          console.log(" 获取业务密级下拉列表数据", res.data.data);
          this.Options1 = res.data.data;
        });
    },
    //  标签管理
    GetLabelTree() {
      metadataRegistrationApi.queryLabelTree().then(res => {
        console.log(res.data.data);
        this.IterationDelateMenuChildren(res.data.data);
        this.queryLabelTree = res.data.data;
      });
    },
    _normalizer(node) {
      return {
        id: node.id,
        label: node.name,
        children: node.child
      };
    },
    // --获取流程基本信息
    GetBaseInfo(versionId) {
      processManagementApi
        .findCataDetailByVersionId({
          versionId: versionId
        })
        .then(res => {
          console.log(" 获取流程基本信息!!!!", res.data.data[0]);
          if (
            !res.data.data &&
            res.data.data[0].label != "" &&
            res.data.data[0].label != null
          ) {
            res.data.data[0].label = res.data.data[0].label.split(",");
          } else {
            res.data.data[0].label = "";
          }
          this.baseInfoData = res.data.data[0];
        });
    },
    // [1]↓获取节点原有信息----------------------------------------------------
    // 1.1-获取节点[基本信息]数据
    GetInfoData(nodeId) {
      processManagementApi.findCataDetail({ nodeId: nodeId }).then(res => {
        console.log("基本信息", res.data.data);
        if (res.data.data[0].label != "" && res.data.data[0].label != null) {
          res.data.data[0].label = res.data.data[0].label.split(",");
        } else {
          res.data.data[0].label = "";
        }
        this.formData2.skyBusiProceNodes = res.data.data;
        console.log(this.formData2);
        this.loading = false;
      });
    },
    // 1.2-获取[执行单位]数据
    GetskyBusiExecDepartments(nodeId) {
      processManagementApi
        .BusinessExecDepartmentfindCata({ busiNodeId: nodeId })
        .then(res => {
          console.log("获取执行单位数据", res.data.data);
          this.formData2.skyBusiExecDepartments = res.data.data;
        });
    },
    // 1.3-获取[信息化系统]数据
    GetBusinessInfoSystem(nodeId) {
      processManagementApi
        .BusinessInfoSystemfindCata({ busiNodeId: nodeId })
        .then(res => {
          console.log("获取信息化系统", res.data.data);
          this.formData2.skyBusiInforSystems = res.data.data;
        });
    },
    // 1.4-获取[上游节点]数据
    BusinessUpstreamNode(nodeId) {
      processManagementApi
        .BusinessUpstreamNodefindCata({ busiNodeId: nodeId })
        .then(res => {
          console.log("获取上游节点", res.data.data);
          this.formData2.skyBusiUpstreamNodes = res.data.data;
        });
    },
    // 1.5-获取[输出参数]数据
    BusinessOutputParam(nodeId) {
      processManagementApi
        .BusinessOutputParamfindCata({ busiNodeId: nodeId })
        .then(res => {
          console.log("获取输出参数", res.data.data);
          this.formData2.skyBusiOutputParams = res.data.data;
        });
    },
    // 1.6获取[业务规则]数据
    BusinessRule(nodeId) {
      processManagementApi
        .BusinessRulefindCata({ busiNodeId: nodeId })
        .then(res => {
          console.log("获取业务规则", res.data.data);
          this.formData2.skyBusiRules = res.data.data;
        });
    },
    // [1]↑获取节点原有信息----------------------------------------------------
    // [2]流程节点相关功能-----------------------------------------------------
    // 2.1-执行单位[添加]/[修改]弹出层
    add1() {
      this.showDialog1 = true; // 显示执行单位弹出层
      this.GetAoptions();
    },
    // 点击弹出执行单位弹出层
    up1(index, data) {
      console.log(data);
      this.showDialog11 = true; // 显示执行单位弹出层
      this.GetAoptions();
      // 回填
      // if (data && data.id) {
      //   this.templateJson1.unitName = data.unitName;
      //   this.templateJson1.id = data.id;
      //   this.templateJson1.execOffice = data.execOffice;
      // }
      this.templateJson1 = data;
    },
    // 2.1.1-执行单位弹出层:获取系统名称下拉列表
    GetAoptions() {
      processManagementApi.findOrgCatalogTree().then(res => {
        console.log(" 获取单位名称下拉列表", res.data.data);
        this.Aoptions1 = res.data.data;
      });
    },
    // 2.2-信息化系统[添加]/[修改]弹出层
    add2(index, data) {
      console.log("data!!!!!!!", data);
      this.showDialog2 = true;
      this.GetBoptions();

      this.templateJson2 = {
        systemName: "", // 系统名称
        execRole: "" // 执行角色
      };
    },
    // 点击弹出修改信息化系统修改弹出层
    up2(index, data) {
      this.showDialog22 = true; // 信息化系统弹出层
      this.GetBoptions();
      // if (data && data.id) {
      //   this.templateJson2.id = data.id;
      //   this.templateJson2.execRole = data.execRole;
      //   console.log(this.templateJson2.id);
      // }
      this.templateJson2 = data;
    },
    // 2.2.1-获取系统名称下拉列表数据
    GetBoptions() {
      processManagementApi.findAllSys().then(res => {
        console.log(" 获取系统名称下拉列表数据----", res.data.data);
        this.Boptions1 = res.data.data;
        this.Doptions2 = res.data.data;
      });
    },
    // 3.1-上游节点[添加]/[修改]弹出层
    add3() {
      this.showDialog3 = true;
      this.GetCoptions2(); // 获取上游节点下拉列表
      this.templateJson4 = {
        parentNode: "", // 上游节点id
        accessParam: "", // 接入参数
        busiProceName: "", // 上游节点所属流程名
        nodeId: "" // nodeId
      };
    },
    // 点击弹出上游节点上游节点弹出层
    up3(index, data) {
      console.log(index, data);
      this.showDialog33 = true;
      this.GetCoptions2(data.nodeId); // 获取上游节点下拉列表
      this.templateJson3 = data;
    },
    // 点击弹出输出参数弹出层
    up4(index, data) {
      console.log(index, data);
      console.log("输出参数data", data);
      this.showDialog44 = true;
      this.GetBoptions(); // 获取所属系统下拉列表
      this.templateJson4 = data;
    },
    // 点击弹出[业务规则]弹出层
    up5(index, data) {
      console.log(index, data);
      console.log("业务规则data", data);
      this.showDialog55 = true;
      this.templateJson5 = data;
    },

    // 获取上游节点列表
    GetCoptions2(nodeId) {
      let busiProceId = this.busiProceId;

      processManagementApi.findCata({ busiProceId: busiProceId }).then(res => {
        console.log(" 获取该流程所有节点列表", res.data.data);
        let filterData = res.data.data.filter(item => {
          return item.nodeId != this.nodeId;
        });
        this.Coptions2 = filterData;
      });
    },
    // -上游节点所属流程联动上游节点联动
    ChangeGetCoptions(data) {
      // console.log(data, "!!@#!@#!@");
      // this.GetCoptions2(data.busiProceId);
    },
    // -- 输出参数[添加]/[修改]弹出层
    add4() {
      this.showDialog4 = true;
      this.GetBoptions(); // 获取所属系统下拉列表
      this.templateJson4 = {
        paramType: "0", // 参数类型
        systemName: "", // 所属系统
        paramName: "" // 参数名称
      };
    },
    // -- 业务规则[添加]/[修改]弹出层
    add5() {
      this.showDialog5 = true;
      this.templateJson5 = {
        ruleType: "", // 规则类型
        ruleSummary: "", // 规则概述
        manageRule: "" // 治理规则
      };
    },
    // 修改基本信息
    update1() {
      this.loading = true;
      let nodeId = this.nodeId;
      this.formData2.skyBusiProceNodes[0].nodeId = this.nodeId; // 传入参数所需的节点id
      let params = Object.assign({}, this.formData2.skyBusiProceNodes[0]);
      if (params.label) {
        params.label = params.label.join(",");
      }

      console.log("params", params);
      processManagementApi.BusinessProcessNodeupdateCata(params).then(res => {
        console.log("修改节点基本信息结果", res.data);
        if (res.data.code == 200) {
          this.$message.success("节点基本信息修改成功!");
          this.GetInfoData(nodeId);
          this.showDialog11 = false;
        } else {
          this.$message.error(`节点基本信息修改失败!`);
          this.loading = false;
          this.showDialog11 = false;
        }
        this.loading = false;
      });
    },
    // 修改执行单位
    update2(data) {
      let params = this.templateJson1; // 当前弹出层执行单位数据
      let nodeId = this.nodeId;
      processManagementApi
        .BusinessExecDepartmentupdateCata(params)
        .then(res => {
          console.log("修改节点基本信息结果", res.data);
          if (res.data.code == 200) {
            this.$message.success("节点基本信息修改成功!");
            this.GetskyBusiExecDepartments(nodeId);
            this.showDialog11 = false;
          } else {
            this.$message.error(`节点基本信息修改失败!`);
            this.showDialog11 = false;
            this.loading = false;
            this.GetskyBusiExecDepartments(nodeId);
          }
        });
    },
    // 修改信息化系统
    update3(data) {
      let params = this.templateJson2;
      console.log(params);
      let nodeId = this.nodeId;
      processManagementApi.BusinessInfoSystemupdateCata(params).then(res => {
        console.log("修改信息化系统", res.data);
        if (res.data.code == 200) {
          this.$message.success("信息化系统修改成功!");
          this.GetBusinessInfoSystem(nodeId);
          this.showDialog22 = false;
          this.showDialog1 = false;
        } else {
          this.$message.error(`信息化系统修改失败!`);
          this.showDialog22 = false;
          this.loading = false;
          this.GetBusinessInfoSystem(nodeId);
        }
      });
    },
    // 修改上游节点
    update4(data) {
      let params = this.templateJson3; //
      let nodeId = this.nodeId;
      console.log("上游节点参数", params);
      processManagementApi.BusinessUpstreamNodeupdateCata(params).then(res => {
        console.log("上游节点修改结果", res.data);
        if (res.data.code == 200) {
          this.$message.success("上游节点修改成功!");
          this.BusinessUpstreamNode(nodeId);
          this.showDialog33 = false;
          this.showDialog1 = false;
        } else {
          this.$message.error(`上游节点修改失败!`);
          this.showDialog33 = false;
          this.loading = false;
          this.BusinessUpstreamNode(nodeId);
        }
      });
    },
    // 修改输出参数
    update5() {
      let params = this.templateJson4; //
      let nodeId = this.nodeId;
      console.log("上游节点参数", params);
      processManagementApi.BusinessOutputParamupdateCata(params).then(res => {
        console.log("上游节点修改结果", res.data);
        if (res.data.code == 200) {
          this.$message.success("输出参数修改成功!");
          this.BusinessOutputParam(nodeId);
          this.showDialog44 = false;
          this.showDialog1 = false;
        } else {
          this.$message.error(`输出参数修改失败!`);
          this.showDialog44 = false;
          this.loading = false;
          this.BusinessOutputParam(nodeId);
        }
      });
    },
    // 修改业务规则
    update6() {
      let params = this.templateJson5;
      let nodeId = this.nodeId;
      console.log("业务规则提交参数", params);
      processManagementApi.BusinessRuleupdateCata(params).then(res => {
        console.log("业务规则修改结果", res.data);
        if (res.data.code == 200) {
          this.$message.success("业务规则修改成功!");
          this.BusinessRule(nodeId);
          this.showDialog55 = false;
          this.showDialog1 = false;
        } else {
          this.$message.error(`业务规则修改失败!`);
          this.showDialog55 = false;
          this.loading = false;
          this.BusinessRule(nodeId);
        }
      });
    },
    // 添加执行单位 确定按钮
    sure1() {
      let params = this.templateJson1;
      let nodeId = this.nodeId;
      console.log("params", params);
      params.busiProceId = this.nodeId;
      processManagementApi
        .BusinessExecDepartmentcreateCata(params)
        .then(res => {
          console.log("添加执行单位", res.data);
          if (res.data.code == 200) {
            this.$message.success("添加执行单位成功!");
            this.GetskyBusiExecDepartments(nodeId);
            this.showDialog1 = false;
          } else {
            this.$message.error(`添加执行单位失败!`);
            this.loading = false;
            this.GetskyBusiExecDepartments(nodeId);
          }
        });
      // 清空执行单位模版数据
      this.templateJson1 = {
        unitName: "", // 单位名称
        execOffice: "" // 执行处室
      };
      this.showDialog1 = false; // 关闭添加执行单位弹出层
    },
    // 添加信息化 确定按钮
    sure2() {
      let params = this.templateJson2;
      let nodeId = this.nodeId;
      console.log("params", params);
      params.busiProceId = this.nodeId;
      processManagementApi.BusinessInfoSystemcreateCata(params).then(res => {
        console.log("添加执行单位", res.data);
        if (res.data.code == 200) {
          this.$message.success("添加执行单位成功!");
          this.GetBusinessInfoSystem(nodeId);
          this.showDialog1 = false;
        } else {
          this.$message.error(`添加执行单位失败!`);
          this.loading = false;
          this.GetBusinessInfoSystem(nodeId);
        }
      });
      this.templateJson2 = {
        systemName: "", // 系统名称
        execRole: "" // 执行角色
      };

      this.showDialog2 = false; // 关闭添加执行单位弹出层
    },
    // 上游节点 确定按钮
    sure3() {
      let nodeId = this.nodeId;
      this.templateJson3.nodeId = nodeId;
      this.templateJson3.busiProceId = this.baseInfoData.busiProceId;
      this.templateJson3.busiProceName = this.baseInfoData.busiProceName;
      let params = this.templateJson3;
      processManagementApi.BusinessUpstreamNodecreateCata(params).then(res => {
        console.log("添加上游节点", res.data);
        if (res.data.code == 200) {
          this.$message.success("添加上游节点成功!");
          this.BusinessUpstreamNode(nodeId);
          this.showDialog1 = false;
        } else {
          this.$message.error(`添加上游节点失败!`);
          this.loading = false;
          this.BusinessUpstreamNode(nodeId);
        }
        this.showDialog3 = false;
      });
    },
    // 输出参数 确定按钮
    sure4() {
      let nodeId = this.nodeId;
      this.templateJson4.busiProceId = nodeId;
      let params = this.templateJson4;
      processManagementApi.BusinessOutputParamcreateCata(params).then(res => {
        console.log("添加输出参数", res.data);
        if (res.data.code == 200) {
          this.$message.success("添加输出参数成功!");
          this.BusinessOutputParam(nodeId);
          this.showDialog1 = false;
        } else {
          this.$message.error(`添加输出参数失败!`);
          this.loading = false;
          this.BusinessOutputParam(nodeId);
        }
        this.showDialog4 = false;
      });
    },
    // 业务规则确定按钮
    sure5() {
      let nodeId = this.nodeId;
      this.templateJson5.busiProceId = nodeId;
      let params = this.templateJson5;
      processManagementApi.BusinessRulecreateCata(params).then(res => {
        console.log("添加业务规则", res.data);
        if (res.data.code == 200) {
          this.$message.success("添加业务规则成功!");
          this.BusinessRule(nodeId);
          this.showDialog1 = false;
        } else {
          this.$message.error(`添加业务规则失败!`);
          this.loading = false;
          this.BusinessRule(nodeId);
        }
        this.showDialog5 = false;
      });
      // this.formData2.skyBusiRules.push(this.templateJson5);
      // console.log(this.formData2);
      // // 清空执行单位模版数据
      // this.templateJson5 = {
      //   ruleType: "", // 规则类型
      //   ruleSummary: "", // 规则概述
      //   manageRule: "" // 治理规则
      // };
      // this.showDialog5 = false; // 关闭添加执行单位弹出层
    },
    // -- 执行单位删除
    del1(index, row) {
      console.log("row", row);
      let nodeId = this.nodeId;
      console.log(row);
      processManagementApi
        .BusinessExecDepartmentdelCataDel({ id: row.id })
        .then(res => {
          console.log("添加流执行单位", res.data);
          if (res.data.code == 200) {
            // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
            this.$message({
              message: "删除执行单位成功",
              type: "success"
            });
            this.GetskyBusiExecDepartments(nodeId);
          } else {
            this.$message({
              message: "删除执行单位失败",
              type: "error"
            });
            this.GetskyBusiExecDepartments(nodeId);
          }
        });
    },
    // -- 信息化系统删除
    del2(index, row) {
      console.log("row", row);
      let nodeId = this.nodeId;
      console.log(row);
      processManagementApi
        .BusinessInfoSystemdelCataDel({ id: row.id })
        .then(res => {
          console.log("添加信息化系统", res.data);
          if (res.data.code == 200) {
            // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
            this.$message({
              message: "删除信息化系统成功",
              type: "success"
            });
            this.GetBusinessInfoSystem(nodeId);
          } else {
            this.$message({
              message: "删除信息化系统失败",
              type: "error"
            });
            this.GetBusinessInfoSystem(nodeId);
          }
        });
    },
    // -- 上游节点删除
    del3(index, row) {
      console.log("row", row);
      let nodeId = this.nodeId;
      console.log(row);
      processManagementApi
        .BusinessUpstreamNodedelCataDel({ id: row.id })
        .then(res => {
          console.log("添加流程节点", res.data);
          if (res.data.code == 200) {
            // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
            this.$message({
              message: "删除流程节点成功",
              type: "success"
            });
            this.BusinessUpstreamNode(nodeId);
          } else {
            this.$message({
              message: "删除流程节点失败",
              type: "error"
            });
            this.BusinessUpstreamNode(nodeId);
          }
        });
    },
    // -- 输出参数删除
    del4(index, row) {
      console.log("row", row);
      let nodeId = this.nodeId;
      console.log(row);
      processManagementApi
        .BusinessOutputParamdelCataDel({ id: row.id })
        .then(res => {
          console.log("添加流程节点", res.data);
          if (res.data.code == 200) {
            // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
            this.$message({
              message: "删除流程节点成功",
              type: "success"
            });
            this.BusinessOutputParam(nodeId);
          } else {
            this.$message({
              message: "删除流程节点失败",
              type: "error"
            });
            this.BusinessOutputParam(nodeId);
          }
        });
    },
    // -- 业务规则删除
    del5(index, row) {
      console.log("row", row);
      let nodeId = this.nodeId;
      console.log(row);
      processManagementApi.BusinessRuledelCataDel({ id: row.id }).then(res => {
        console.log("添加流程节点", res.data);
        if (res.data.code == 200) {
          // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
          this.$message({
            message: "删除流程节点成功",
            type: "success"
          });
          this.BusinessRule(nodeId);
        } else {
          this.$message({
            message: "删除流程节点失败",
            type: "error"
          });
          this.BusinessRule(nodeId);
        }
      });
    },
    // 点击弹出层[确定],提交节点
    submitNode() {
      console.log(this.formData2.skyBusiProceNodes[0].nodeName);
      if (this.formData2.skyBusiProceNodes[0].nodeName) {
        console.log("添加流程节点时formData数据", this.formData2);
        let obj = Object.assign({}, this.formData2);
        if (obj.skyBusiProceNodes[0].label) {
          obj.skyBusiProceNodes[0].label = obj.skyBusiProceNodes[0].label.join(
            ","
          );
        }
        processManagementApi.createCataInsert(obj).then(res => {
          console.log("添加流程节点", res.data);
          if (res.data.code == 200) {
            // this.formData2.skyBusiProceNodes[0].busiProceId = res.data.data; // 将流程ID保存至步骤二添加流程节点的表单中
            this.isStep1 = false; // 进入步骤2
            this.$message({
              message: "添加流程节点成功",
              type: "success"
            });
            this.GetNode();
          } else {
            this.$message({
              message: "添加流程节点失败",
              type: "warning"
            });
          }
          this.showDialog = false; // 关闭流程节点弹出层
        });
        let busiProceId = this.busiProceId;
        let versionId = this.versionId;
        // 重置模板数据
        this.formData2 = {
          // 基本信息
          skyBusiProceNodes: [
            {
              nodeName: "", // 节点名称
              nodeType: "", //  节点类型
              businessBoundary: "", // 业务边界
              label: null, // 标签
              secretLevel: "", // 业务密级
              busiProceId: busiProceId, // 流程ID
              versionId: versionId // 流程ID
            }
          ],
          skyBusiExecDepartments: [], // 执行单位
          skyBusiInforSystems: [], // 信息化系统
          skyBusiUpstreamNodes: [], // 上游节点
          skyBusiOutputParams: [], // 输出参数
          skyBusiRules: [] // 业务规则
        };
      } else {
        this.$message({
          message: "请输入节点名称",
          type: "warning"
        });
      }
    },

    // 改变上游节点时
    ChangeNodeId(data) {
      console.log("选中的上游节点", data);
      // 获取参数名称下拉列表
      let params = {
        busiNodeId: data
      };
      processManagementApi.BusinessOutputParamfindCata(params).then(res => {
        console.log(" 获取参数名称", res.data.data);
        this.templateJson3.accessParam = res.data.data[0]
          ? res.data.data[0].paramName
          : ""; // 将参数名称赋值给表单
      });
    },
    // 改变参数类型
    ChangeParamsType(data) {
      let obj = {};
      obj = this.Doptions1.find(item => {
        return item.id == data;
      });
      this.templateJson4.paramTypeName = obj.name;

      console.log(this.templateJson4);
      this.templateJson4.paramName = "";

      console.log("所选择的参数名称的id", data);
      if (data == 2) {
        this.templateJson4.systemId = ""; // 选择了 其他(值为2) 清空所属系统id传值
        this.templateJson4.systemName = ""; // 选择了 其他(值为2) 清空所属系统id传值
      } else {
        if (this.templateJson4.systemName) {
          let params = {};
          params.type = data; // 接口类型: 0/1/2
          params.sysId = this.templateJson4.systemId; // 传参所属系统id
          // 获取参数名称列表
          processManagementApi
            .MetaDataRegisterfindFileOrIterface(params)
            .then(res => {
              console.log(" 获取参数名称列表------", res.data.data);
              this.Doptions3 = res.data.data;
            });
        }
      }
    },
    // 改变系统id
    ChangeSysId(data) {
      this.templateJson4.paramName = "";
      let obj = {};
      obj = this.Boptions1.find(item => {
        return item.system_id == data;
      });
      this.templateJson4.systemName = obj.system_name;
      let params = {};
      params.sysId = data; // 传参所属系统id
      params.type = this.templateJson4.paramType;
      // 获取参数名称列表
      processManagementApi
        .MetaDataRegisterfindFileOrIterface(params)
        .then(res => {
          console.log(" 获取参数名称列表------", res.data.data);
          this.Doptions3 = res.data.data;
        });
    },

    // 获取上游节点所属流程列表
    GetCoptions() {
      // processManagementApi.tableData().then(res => {
      //   console.log(" 获取上游节点所属流程!列表数据----", res.data.data);
      // this.Coptions1 = res.data.data;
      // });
      // this.Coptions1.push (this.baseInfoData.busiProceName);
    },

    // 获取该流程所有节点列表
    GetNode() {
      let versionId = this.versionId;
      console.log("versionId", versionId);
      processManagementApi
        .ProcessNodefindCataByVersionId({ versionId: versionId })
        .then(res => {
          console.log(" 版本", res.data.data);
          this.NodeForm = res.data.data.list;
        });
    },
    // --------------------------------------
    // // 点击tabs
    // handleClick(tab, event) {
    //   console.log(tab, event);
    //   // 请求接口 => 得到表数据
    // },
    // 获取流程
    // 点击[返回]
    back() {
      // this.$router.push({
      //   path: `/${_routerPath.routerName}/ProcessManagementHost/ProcessManagementLogic`
      // });
      this.$router.go(-1);
    },
    // 提交 --TODO去除
    submit() {
      console.log(this.formData2);
    }
  }
};
</script>
<style lang="less" scoped>

.top {
  height: 0.62rem !important;

  .el-form-item {
    margin: 0px !important;
  }
}

.table {
  height: calc(~"100% - 1.12rem") !important;
}

// Meow Edit ↓------------
.detail{
  height: 100%;
  padding-bottom: 50px;
  .detail-top{
    border-bottom: 1px solid gray;
    padding-bottom: 10px;
    .bb();
    .fdrr();
    margin-bottom: 10px;
  }
.baseInfo{
  ul{
    width: 100%;
    li{
      .jc-b();
      .bb();
      padding: 0 20px;
      width: 100%;
      min-height: 40px;
      label{
        width: 120px;
        min-width: 120px;
        margin-right: 20px;
        text-align: right;
      }
      input{
        flex: 1;
        height: 20px  ;
      }
      span{
        color: red;
        margin-left: 10px;
      }
      .el-cascader{
        width: 100%;
      }
    }
  }
}
.processNode{
   .processNode-top{
     .jc-b();
   } 
  }
}
.detail-top{
  margin-top: 10px;
  margin-bottom: 0!important;
  padding-right: 20px;
  .bb();
}
.nextButton{
  margin: 10px 0;
}
.processNode-top{
  border-top: 1px solid gray;
  padding-right: 20px;
  .bb();
}
h1{
  padding: 10px 0;
  height: auto;
  margin-bottom: 0!important;
}
.el-table{
  margin-bottom: 20px;
}























#ProcessManagement {
  background-color: #fff;
}
.updateBox {
  background-color: #fff;
  width: 100%;
  padding: 20px;
  .bb();
  border-bottom: 1px solid #eaeaea;
}
.nextButton {
  .fdrr();
  .bb();
  button {
    margin: 0 auto;
  }
  padding: 0 20px;
}
.upbtn {
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
}
// .HalfWidth{
//   width: 50%!important;
// }

</style>